/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.moltos.parser;

import java.io.File;
import java.util.List;
import java.util.Scanner;

/**
 *
 * @author MoLt1eS
 */
public class ChatParserTeste {
    static Scanner in = new Scanner(System.in);
    
    public static void main( String[] args ){
        int op;
        File dir = new File("./chat");
        File[] saves = dir.listFiles();
        
        if(saves==null){
            System.out.println("Nao existe ficheiros a carregar!");
            return;
        }
        for(int i=0; i<saves.length;i++){
            System.out.println(i+1+" - "+saves[i].getName());
        }
        do{
            System.out.println("Numero do save a carregar: ");
            op = in.nextInt();
        }while(op<0 && op>saves.length);
        
        ChatParser cp = new ChatParser(saves[op-1]);
        System.out.println(cp.getName());
        System.out.println(cp.getName_target());
        System.out.println(cp.isStart());
        System.out.println(cp.getnLines());
        List<String> lines = cp.getLines();
        for (int i = 0; i < lines.size(); i++){
            System.out.println(lines.get(i));
        }
        
    }
}
